package com.estronger.shopmanage.ui.othertask.bean;


import com.soonfor.evaluate.tools.CommonUtils;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by DingYg on 2018-01-30.
 */

public class OtherTaskMainBean implements Serializable {

    /**
     * “ftotalcount”:0//总记录数
     * “data”:[{
     * “fplantaskid”:0,//任务id
     * “fplantasktype”:”5”,//任务类型：5.主动追踪任务，6.回访任务
     * “ftitle”:”上门保养”,//任务标题
     * “fprocstatedesc”:”进行中”,//状态描述
     * “fcname”:”张三”,//客户名称
     * “fsexdesc”:”先生”,//客户性别
     * “fmobile”:”13169854563”,//手机
     * “fbuildname”:”雅居乐天宇小区”,//楼盘名称
     * “ftaskmode”:”0”,//任务方式:0.单次任务，1.期限任务
     * “fplantime”:”2018-10-22 20:40:28.853”,//计划开始时间
     * “fplantime2”:”2018-10-22 20:40:28.853”,//计划截止时间
     * “fpoint”:0,//工分
     * “fexectype”:”0”,//执行类型,0.电话，1.上门，2.邮寄，3.自主执行，4.系统执行
     * “foverduenum”:0,//延期天数
     * “fexecutedt”:” 2018-10-22 20:40:28.853”//完成时间
     * “fopportunitypoint”:15,//再销售商机报备积分
     */
    private String ftotalcount;//总记录数
    private List<DataBean> data;//总列表

    public String getFtotalcount() {
        return ftotalcount;
    }

    public List<DataBean> getData() {
        return data==null?new ArrayList<DataBean>():data;
    }

    public static class DataBean implements Serializable{
        private String fplantaskid;//任务id
        private int fplantasktype;//任务类型：5.主动追踪任务，6.回访任务
        private String ftitle;//任务标题
        private String fprocstatedesc;//状态描述
        private String fcname;//客户名称
        private String fsexdesc;//客户性别
        private String fmobile;//手机
        private String fbuildname;//楼盘名称
        private int ftaskmode;//任务方式:0.单次任务，1.期限任务
        private String fplantime;//计划开始时间
        private String fplantime2;//计划截止时间
        private String fpoint;//工分
        private int fexectype;//执行类型,0.电话，1.上门，2.邮寄，3.自主执行，4.系统执行
        private String foverduenum;//延期天数
        private String fexecutedt;//完成时间
        private String fopportunitypoint;//再销售商机报备积分

        public void setFplantaskid(String fplantaskid) {
            this.fplantaskid = fplantaskid;
        }

        public String getFplantaskid() {
            return CommonUtils.formatStr(fplantaskid);
        }

        public int getFplantasktype() {
            return fplantasktype;
        }

        public void setFplantasktype(int fplantasktype) {
            this.fplantasktype = fplantasktype;
        }

        public String getFtitle() {
            return CommonUtils.formatStr(ftitle);
        }

        public int getStatus(){
            if(getFprocstatedesc().contains("进行中")){
                return 1;
            }
            if(getFprocstatedesc().contains("逾期")){
                return 2;
            }
            if(getFprocstatedesc().contains("已完成") || getFprocstatedesc().contains("已邮寄")){
                return 3;
            }
            return 0;
        }

        public String getFprocstatedesc() {
            return CommonUtils.formatStr(fprocstatedesc);
        }

        public void setFprocstatedesc(String fprocstatedesc) {
            this.fprocstatedesc = fprocstatedesc;
        }

        public String getFcname() {
            return CommonUtils.formatStr(fcname);
        }

        public String getFsexdesc() {
            return CommonUtils.formatStr(fsexdesc);
        }

        public String getFmobile() {
            return CommonUtils.formatStr(fmobile);
        }

        public String getFbuildname() {
            return CommonUtils.formatStr(fbuildname);
        }

        public int getFtaskmode() {
            return ftaskmode;
        }

        public String getFplantime() {
            return CommonUtils.formatStrTime(fplantime);
        }

        public String getFplantime2() {
            String endTime = CommonUtils.formatStrTime(fplantime2);
            if(!endTime.equals("") && !endTime.equals(getFplantime())){
                return " 至 " + endTime;
            }else {
                return "";
            }
        }

        public String getFpoint() {
            return CommonUtils.formatNum(fpoint);
        }

        public int getFexectype() {
            return fexectype;
        }


        public String getExectypeDesc() {
            switch (fexectype) {
                case 0:
                    return "电话";
                case 1:
                    return "上门";
                case 2:
                    return "邮寄";
                case 3:
                    return "自主执行";
                case 4:
                    return "系统执行";
            }
            return "";
        }

        public String getFoverduenum() {
            return CommonUtils.formatStr(foverduenum);
        }

        public String getFexecutedt() {
            return CommonUtils.formatStrTime(fexecutedt);
        }

        public String getFopportunitypoint() {
            return CommonUtils.formatStr(fopportunitypoint);
        }
    }
}
